<?php App::Helper('Toolbar')->setTitle("Batch Operation")->setBtnBack()->Render(array('code'=>'promocode_batch_top')); ?>
	<form method="post">
	<?php

		App::Module('DataGrid') 
			->setDisplay('FormListing')
			->addRow(
				'Select Contest',
				//App::InformationSet('e2wretailer')->Tag("data[Batch][retailer]",'',array("key"=>"id","val"=>"retailername"), array('class'=>'check_notempty')) . ' ' . 
				App::InformationSet('e2wcontest')->Tag("data[Batch][contest]",$contestid,array("key"=>"id","val"=>"contestname"), array('class'=>'check_notempty')) . ' ' . 
				App::load("Helper/Html")->inputTag("data[Batch][nof]",'0',array("id"=>"nof","style"=>"width:20px")) . ' ' .
				App::load("Helper/Html")->submitTag("data[Batch][Submit]",'Create and View > ',array("class"=>"button"))
			)
			->Render();
	
	
		if(!empty($promoList['data']))
		{
			echo "<h3>PROMOT CODE LIST</h3>";
			$Grid = App::Module('DataGrid')->clear();
			$Grid->setHeader(array('Identifier','Promo Code', 'Contest'));
			$Grid->setFooter();
			foreach($promoList['data'] as $key => $row)
			{			
				$Grid->addRow(
					$row['id'],
					$row['promocode'],
					App::InformationSet()->idToName($row['contest'],'contestname')		
				);
			}
			$Grid->Render();
		}
		
	?>
	</form>
	<?php  App::Helper('JavaScript')->setAjax(array("debug"=>false,"autoHide"=>false))->appForm('from');?>
	<?php App::Helper('Toolbar')->setBtnBack()->Render(array('code'=>'promocode_batch_bottom')); ?>
